package com.ruoyi.framework.web.exception;

import com.ruoyi.framework.web.domain.AjaxResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * com.ruoyi.framework.web.exception.AjaxResultExceptionHandler
 * <br>
 *
 * @author 蒋カイセキ    Japan-Tokyo  19-4-16 下午1:30<br>
 * ブログ http://www.shoukaiseki.top/<br>
 * E-メール jiang28555@Gmail.com<br>
 **/
@RestControllerAdvice
public class AjaxResultExceptionHandler {

    /**
     * 给予前端错误提示
     */
    @ExceptionHandler(AjaxResultException.class)
    public AjaxResult handleException(AjaxResultException e)
    {
        return AjaxResult.error(e.getMessage());
    }
}
